﻿<style>
    .page-list {
        display: flex;
    }
</style>
<div>
    <div class="form-inline pull-right">
        <button class="btn btn-info waves-effect" ng-click="list.GetPageData(paginationConf.currentPage, paginationConf.itemsPerPage);">
            <span class="glyphicon glyphicon-refresh"></span>
        </button>
        <div class="input-group">
            <span class="input-group-addon">全局搜索：</span>
            <div class="fg-line">
                <input type="text" class="form-control" ng-change="search(kw)" ng-model="kw" placeholder="全局搜索" />
            </div>
        </div>
    </div>
    <table ng-table="list.tableParams" class="table table-bordered table-hover table-condensed table-responsive editable-table listTable" ng-form="list.tableForm" disable-filter="list.isAdding" tracked-table="list.tableTracker">
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row">
            <td title="'原标题'">
                <a ng-href="/{{row.PostId}}" target="_blank">{{row.PostTitle}}</a>
            </td>
            <td title="'新标题'">
                <a ng-href="#/merge/compare?id={{row.Id}}" target="_blank">{{row.Title}}</a>
            </td>
            <td title="'修改人'">
                <a ng-href="/author/{{row.Modifier}}" target="_blank">{{row.Modifier}}</a>
            </td>
            <td title="'修改人邮箱'">
                {{row.ModifierEmail}}
            </td>
            <td title="'提交时间'">
                {{row.SubmitTime|date:'yyyy-MM-dd HH:mm:ss'}}
            </td>
            <td title="'IP'">
                <a ng-href="/tools/ip/{{row.IP}}" target="_blank">{{row.IP}}</a>
                <button class="badge btn btn-primary pull-right" ng-click="addToBlackList(row.IP)">黑名单</button>
            </td>
            <td title="'状态'">
                <span ng-if="row.MergeState==0" class="text-warning">待合并</span>
                <span ng-if="row.MergeState==1" class="text-success">已合并</span>
                <span ng-if="row.MergeState==2" class="text-danger">已拒绝</span>
                <span ng-if="row.MergeState==3" class="text-danger">已被标记为恶意修改</span>
            </td>
            <td title="'操作'" style="max-width: 400px">
                <div class="btn-group" ng-if="row.MergeState==0">
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/merge/compare?id={{row.Id}}">
                        对比
                    </a>
                    <button class="btn btn-success btn-sm waves-effect" ng-click="list.pass(row)">
                        直接合并
                    </button>
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/merge/edit?id={{row.Id}}">
                        编辑并合并
                    </a>
                    <button class="btn btn-danger btn-sm waves-effect" ng-click="list.reject(row)">
                        拒绝
                    </button>
                    <button class="btn btn-primary btn-sm waves-effect" ng-click="list.block(row)">
                        标记为恶意修改
                    </button>
                </div>
            </td>
        </tr>
    </table>
    <tm-pagination conf="paginationConf"></tm-pagination>
</div>